/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package hbr;

import java.io.Serializable;
import java.util.Collection;

/**
 * Provides basic CRUD operations on objects of persistent classes
 *
 */
public interface ORM {
    //void openSession();

    public void saveOrUpdate(Object obj);

    public Collection getAll(Class cl);

    public Object getById(Class cl, Serializable id);

    public void delete(Object obj);

    /**
     * Returns collection of objects which satisfies named query
     * @param namedQuery - name of query described in .hbm.xml files
     * @param values - collection of parameters
     * @return collection of objects satisfy the query
     */
    public Collection getWith(String namedQuery, Collection<String> values);

    public void update(Object obj);

    /**
     * Returns collection of objects which satisfies named query
     * @param namedQuery - name of query described in .hbm.xml files
     * @param values - parameter-collection or query
     * @return collection of objects satisfy the query
     */
    public Collection getWithList(String namedQuery, Collection<String> values);
    //void closeSession();
}
